<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
  
  <!-- This is the start (home) page of the application. It just displays
  a message. Not very exciting... improvement is possible. -->
  <h:head>
    <title>IGNORED</title>
  </h:head>
  <h:body>
    <ui:composition template="/templates/stud_layout.xhtml">
      <ui:define name="content">
          <h2>#{strings.forelesning_h1}</h2>
          <p>#{strings.forelesning_p1}</p>
          <h:form>
              
          <h:panelGrid columns="2">
            <h:outputText value="#{strings.forelesning_id}:" rendered="#{forelbean.updating}"  />
            <h:outputText value="#{forelbean.forelsningNr}" rendered="#{forelbean.updating}" />
            <h:outputText value="#{strings.forelesning_navn}:" />
          </h:panelGrid>
           
         <h:panelGroup>
              <h:inputText id="navn" label="#{strings.forelesning_navn}"
                           value="#{forelbean.navn}" required="true" />
              <h:message for="navn" />
            </h:panelGroup> <br />
          
        <h:panelGroup>
        <h:outputText value="#{strings.forelesning_tema}:" /> <br />
              <h:inputText id="tema" label="#{strings.forelesning_tema}"
                           value="#{forelbean.tema}" required="true" />
              <h:message for="tema" />
        </h:panelGroup> <br />
        
        <h:panelGroup>
        <h:outputText value="#{strings.forelesning_dato}:" /> <br />
              <h:inputText id="dato" label="#{strings.forelesning_dato}"
                           value="#{forelbean.dato}" required="true" />
              <h:message for="dato" />
        </h:panelGroup> <br />
        
        <h:panelGroup>
        <h:outputText value="#{strings.forelesning_kommentar}:" /> <br />
              <h:inputTextarea id="kommentar" label="#{strings.forelesning_kommentar}"
                           value="#{forelbean.kommentar}" required="true" />
              <h:message for="kommentar" />
        </h:panelGroup> <br /> <br />
        
        <h:commandButton value="#{strings.forelesning_save}"
                           action="#{forelbean.saveForelesning}" />
          </h:form>
      </ui:define>
    </ui:composition>
  </h:body>
</html>